﻿namespace MMessaging.Test.Fahrstuhl.Engine
{
	public abstract class ButtonStateBase
	{
		public bool Pressed
		{
			get;
			set;
		}

		public ButtonStateBase(bool pressed)
		{
			Pressed = pressed;
		}

		public abstract ButtonStateBase Copy();

		public abstract bool IsButton(ButtonStateBase otherButtonState);
	}

	public abstract class ButtonStateBase<SELF> : ButtonStateBase
		where SELF : ButtonStateBase<SELF>
	{

		public ButtonStateBase(bool pressed) : base(pressed)
		{
		}

		public abstract SELF CopyTypeSafe();

		public override ButtonStateBase Copy()
		{
			return CopyTypeSafe();
		}
	}
}